<?php

class EntryTemplate
{
    
    var $spacer = '&nbsp;&nbsp;&nbsp;';
    
    function paint(& $data, $depth, $mode)
    {
        static $users = array();
        if (!$users[$data['author_id']])
            $users[$data['author_id']] = $GLOBALS['dbauser']->get($data['author_id']);
        $html = '';
        for ($i=0;$i<$depth;$i++)
            $html .= $this->spacer;
        $html .= "<a class=\"entrytitle\" href=\"?action=showEntry&entryid="
            ."{$data['id']}&doc_id={$GLOBALS['doc_id']}\">{$data['title']}</a> <span "
            ."class=\"entrydate\">{$data['date']}</span> ".($data['external_author']?$data['external_author']:$users[$data['author_id']]['name'])."<br/>";
        return $html;
    }
}
?>